﻿function IsMobilePhone(value) {
    if (/^13\d{9}$/g.test(value) || (/^15\d{9}$/g.test(value)) || (/^18\d{9}$/g.test(value)) || (/^14\d{9}$/g.test(value))) return true;
    else return false;
}
function GetlengthB(str) {
    return str.replace(/[^\x00-\xff]/g, "**").length;
}
function IsURL(str_url) {
    var url_reg = /^((http(s)?|ftp|telnet|news|rtsp|mms):\/\/)?(((\w(\-*\w)*\.)+[a-zA-Z]{2,4})|(((1\d\d|2([0-4]\d|5[0-5])|[1-9]\d|\d).){3}(1\d\d|2([0-4]\d|5[0-5])|[1-9]\d|\d).?))(:\d{0,5})?(\/+.*)*$/;
    return url_reg.test(str_url)
}
function IsMoeny(str) {
    var money_reg = /^([1-9]\d*|\d+\.\d+)$/;
    return money_reg.test(str);
}
function changeTwoDecimal(x) {
    var f_x = parseFloat(x);
    if (isNaN(f_x)) {
        alert('function:changeTwoDecimal->parameter error');
        return false;
    }
    var f_x = Math.round(x * 100) / 100;
    return f_x;
}
function getObj(a) {
    return (typeof(a) == "object") ? a: document.getElementById(a)
}
function ChangeMultiple() {
    if (!getObj('Province').multiple) {
        getObj('Province').multiple = "multiple";
        getObj('Province').size = "6";
        getObj('Province').title = "按住Ctrl或Shifl键加单击选项，可多选！";
        $('#City').hide();
    } else {
        getObj('Province').multiple = false;
        getObj('Province').size = "0";
        getObj('Province').title = "";
        $('#City').show();
    }
}
function gotourl(url) {
    window.location.href = url;
}
function OpenQQ(qq) {
    artDialog({
        content: '对方的QQ号为：' + qq + '<br/>临时会话信息会经常接收不到，请尽量把对方QQ加为好友。<bt/>点击确定后为您转向临时会话。',
        id: "alarm",
        parent: true,
        fixed: true
    },
    function() {
        window.open('tencent_3A//message/@uin=' + qq + '&Site=大麦户平台&Menu=yes', "_self");
    },
    function() {});
}